import axios from '@/libs/api.request'

/**
 * 表具表格数据
 * @param  {[type]} params [description]
 * @return {[type]}        [description]
 */
export const fetchTableData = (data) => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterBeanListPage',
    method: 'post',
    data
  })
}

/**
 * 获取类型
 * @return {[type]}        [description]
 */
export const fetchMeterTypes = () => {
  return axios.request({
    url: '/api/meterManage/params/getMeterTypeList',
    method: 'get'
  })
}

/**
 * 获取次级部门
 * @return {[type]}        [description]
 */
export const fetchMeterSectors = () => {
  return axios.request({
    url: '/api/meterManage/params/getMeterSectorList',
    method: 'get'
  })
}

/**
 * 获取型号
 * @return {[type]}        [description]
 */
export const fetchMeterModels = () => {
  return axios.request({
    url: '/api/meterManage/params/getMeterModelList',
    method: 'get'
  })
}

/**
 * 获取用气性质
 * @return {[type]}        [description]
 */
export const fetchMeterGasClass = () => {
  return axios.request({
    url: '/api/meterManage/params/getMeterGasClass',
    method: 'get'
  })
}

/**
 * 表格数据修改
 * @param  {[type]} params [description]
 * @return {[type]}        [description]
 */
export const saveData = (data) => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/insertMeter',
    method: 'post',
    data
  })
}

/**
 * 表格数据修改
 * @param  {[type]} params [description]
 * @return {[type]}        [description]
 */
export const fetchMeterUnitDetail = (id) => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterUnitDetail/' + id,
    method: 'get'
  })
}
